home *** CD-ROM | disk | FTP | other *** search
/ PC User 2002 July / Disc 2 / PCU0702CD2.iso / entertn / floaters / files / Control / GameInstaller / data1.cab / GameDxr / Floaters.dxr / 00006_loop Frame.ls < prev    next >
Encoding:
Text File  |  2002-05-17  |  2.7 KB  |  81 lines

  1. property pCounter, pOldMouseLoc
  2. global gPaused, gTempActorList, cDotSpacing, cGridSize, cDmVctChnl, cSquareChnl, cGridChnl, cHiDotChnl, cGridHOffset, cGridVOffset, gErrCounter, gClicked, gTimer
  3.  
  4. on beginSprite me
  5.   pOldMouseLoc = the mouseLoc
  6. end
  7.  
  8. on prepareFrame
  9.   if (the mouseLoc <> pOldMouseLoc) and not gPaused then
  10.     curH = the mouseH
  11.     curV = the mouseV
  12.     if (curH >= cGridHOffset) and (curH <= (cGridHOffset + (cGridSize * cDotSpacing))) and ((curV >= cGridVOffset) and (curV <= (cGridVOffset + (cGridSize * cDotSpacing)))) then
  13.       spaceOffset = point(cGridHOffset - (cDotSpacing / 2), cGridVOffset - (cDotSpacing / 2))
  14.       dotOffset = 9
  15.       repeat with counter = 1 to 16
  16.         hLoc = spaceOffset[1] + (counter * cDotSpacing)
  17.         if the mouseH < hLoc then
  18.           curH = hLoc - dotOffset
  19.           exit repeat
  20.         end if
  21.         if (counter = 16) and (the mouseH > hLoc) then
  22.           curH = hLoc + cDotSpacing - dotOffset
  23.         end if
  24.       end repeat
  25.       repeat with counter = 1 to 16
  26.         vLoc = spaceOffset[2] + (counter * cDotSpacing)
  27.         if the mouseV < vLoc then
  28.           curV = vLoc - dotOffset
  29.           exit repeat
  30.         end if
  31.         if (counter = 16) and (the mouseV > vLoc) then
  32.           curV = vLoc + cDotSpacing - dotOffset
  33.         end if
  34.       end repeat
  35.       sprite(cSquareChnl).loc = point(curH, curV)
  36.     else
  37.       if not gClicked then
  38.         if sprite(cSquareChnl).locH <> -500 then
  39.           sprite(cSquareChnl).locH = -500
  40.         end if
  41.       end if
  42.     end if
  43.   end if
  44.   if (curH >= cGridHOffset) and (curH <= (cGridHOffset + (cGridSize * cDotSpacing))) and ((curV >= cGridVOffset) and (curV <= (cGridVOffset + (cGridSize * cDotSpacing)))) and gClicked then
  45.     curH = sprite(cSquareChnl).locH
  46.     curV = sprite(cSquareChnl).locV
  47.     oldH = sprite(cHiDotChnl).locH
  48.     oldV = sprite(cHiDotChnl).locV
  49.     if (oldH <> curH) or (oldV <> curV) then
  50.       vtxList = member("DmVct").vertexList
  51.       prevLoc = getProp(vtxList[2], #vertex)
  52.       newH = curH - oldH + 1
  53.       newV = curV - oldV + 1
  54.       if prevLoc <> point(newH, newV) then
  55.         setProp(vtxList[2], #vertex, point(newH, newV))
  56.         member("DmVct").vertexList = vtxList
  57.       end if
  58.     else
  59.       member("DmVct").vertexList = [[#vertex: point(1, 1)], [#vertex: point(1, 1)]]
  60.     end if
  61.   end if
  62. end
  63.  
  64. on exitFrame
  65.   if the timer > (gTimer + 100) then
  66.     if sprite(cHiDotChnl).visible and sprite(cHiDotChnl + 1).visible then
  67.       removeHiDots()
  68.     end if
  69.     if gErrCounter > 0 then
  70.       removeHiDots()
  71.       removeErrVcts()
  72.       gTimer = the timer
  73.     end if
  74.   end if
  75.   if not gPaused and (the actorList = []) then
  76.     the actorList = duplicate(gTempActorList)
  77.     gTempActorList = []
  78.   end if
  79.   go(the frame)
  80. end
  81.